package com.zb.entity.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author WEN
 * @Date 2024/1/24 0024
 **/
@Data
@ApiModel("工单表头对象")
public class OrderTableFieldDto {

    @ApiModelProperty(value = "表头ID，新增不必传，修改必传")
    private Long id;

    @NotBlank(message = "表头字段名称不能空")
    @Length(min = 2, max = 10, message = "表头字段名称长度限制输入 2 ~ 10位")
    @ApiModelProperty(value = "列表字段名称", required = true)
    private String name;

    @NotBlank(message = "表头字段代码不能为空")
    @Length(min = 2, max = 60, message = "表头字段名称长度限制输入 2 ~ 60位")
    @ApiModelProperty(value = "列表字段代码", required = true)
    private String code;

    @NotNull(message = "显示列选项不能为空")
    @ApiModelProperty(value = "是否显示列：false-默认隐藏，true-默认显示", required = true, example = "true")
    private Boolean showColumn;

    @NotNull(message = "冻结列选项不能为空")
    @ApiModelProperty(value = "是否冻结列：false-默认解冻，true-默认冻结", required = true, example = "false")
    private Boolean freezeColumn;

    @Max(value = Integer.MAX_VALUE, message = "排序数据值不合法，数据超长")
    @ApiModelProperty(value = "排序，数值越大，直靠前", example = "0")
    private Integer sort;

    @NotNull(message = "表头字段状态不能为空")
    @ApiModelProperty(value = "表头字段状态：false-启用，true-禁用", required = true, example = "false")
    private Boolean status;
}
